package demo1;

public class demo5 {
    public static void main(String[] args) throws InterruptedException {
        Object object = new Object();
        Thread t = new Thread(()->{
           synchronized (object) {
               System.out.println("等待之前");
               try {
                   object.wait(50000);
               } catch (InterruptedException e) {
                   throw new RuntimeException(e);
               }
               System.out.println("等待之后");
           }
        });
        t.start();

    }
}
